using System.Collections;
using Net.Common;
using UnityEngine;

/****************************************************
// 功能：大厅窗口业务
// | Talk To [ 聊来改善地区金融服务环境，助力企业发展 ]
// | Copyright (c) 2021-2025 聊来 All rights reserved.
// | Licensed ( <a href="http://www.apache.org/licenses/LICENSE-2.0">聊来</a> )
// | @Author: 贯彻己道的云 <18970881148@qq.com>
// | DateTime: 2025/2/22 20:6:17
*****************************************************/

public class LobbyController : BaseController<LobbyController>
{
    public override void InitController()
    {
        base.InitController();
        //Debug.Log("LobbyController Init");
    }

    /// <summary>
    /// 发送匹配请求
    /// </summary>
    /// <param name="title"></param>
    public void OnMatch(string title)
    {
        SendByTcp(RequestType.MATCH, new MatchRequest()
        {
            type = Constants.NUM_ZERO,
            userName = model.userInfo.userName,
            teamType = title.Equals("多人排位") ? Constants.TEAM_FIVE : Constants.TEAM_ONE
        });
    }

    public void EnterLobby()
    {
        resource.AsyncScene(Constants.SCREEN_LOGIN, null, null);
        ui.Open(WindowName.Lobby);
        ui.DestoryWindow(WindowName.Result);
    }
}
